<template>
	<view class="userteam">
		<view class="tips">
			<text>{{username}}(本人)</text>
			<text>等级：{{level_name}}</text>
			<text>伞下人数：{{count}} </text>
			<!-- {{username}}(本人), 等级：{{level_name}}, 伞下人数:{{count}} -->
		</view>
		<view class="tips teams">
			<text>个人累计消费：￥{{money}}</text>
			<text>团队业绩：￥{{Number(total_achievement)}}</text>
			<!-- 个人累计消费：{{money}},团队业绩：{{Number(total_achievement)}} -->
		</view>

		<view class="goodlist" v-for="(item,index) in team" :key="index">
			<view class="goodsdetail">
				<view class="title">
					<text>{{item.add_time}}</text>
					<text>等级：{{item.level_name}}</text>
				</view>
				<view class="goodsinfo">
					<view class="msg">
						<view class="name">
							<text>{{item.username}}({{item.name}})</text>
							<!-- <text>累计消费：{{item.allmoney}}</text> -->
							<text>团队业绩：￥{{Number(item.total_achievement)}}</text>
						</view>
					</view>
				</view>
			
			</view>

		</view>


	</view>
</template>

<script>
	import { UserTeam } from '../../api/user.js'
	export default {
		data() {
			return {
				team:[],
				count:0,
				level_name:'会员',
				total_achievement:'',
				money:0,
				username:''
			}
		},
		onLoad() {
			this.getTeam()
		},
		methods: {
			getImg(url){
				return this.websiteUrl + url
			},
			getTeam(){
				UserTeam().then(res=>{
					console.log(res)
					this.count = res.data.count
					this.level_name = res.data.level_name
					this.money = res.data.money
					this.username = res.data.username
					this.total_achievement = res.data.total_achievement
					this.team = res.data.list
				})
			}
		}
	}
</script>

<style>
	page{
		background: #f8f8f8;
	}
	.teams{
		flex-direction: column;
	}
	.teams text{
		padding-bottom: 10px;
	}
	.userteam .tips {
		background: #fff3dc;
		color: #f23030;
		padding: 2% 5%;
		font-size: 15px;
		display: flex;
		justify-content: space-between;
	}
	

	.userteam .goodsdetail {
		margin-top: 20rpx;
		background-color: #fff;
		padding: 20rpx 0;
	}

	.userteam .goodsdetail .title {
		display: flex;
		justify-content: space-between;
		padding: 0 5%;
	}

	.userteam .goodsdetail .title text {
		font-size: 12px;
	}

	.userteam .goodsinfo {
		display: flex;
		padding: 3%;
	}

	.userteam .goodsinfo image {
		width: 150rpx;
		height: 120rpx;
	}

	.userteam .goodsinfo .msg {
		width: 93%;
		margin-left: 5%;
	}

	.userteam .goodsinfo .msg .name {
		font-size: 13px;
		display: flex;
		justify-content: space-between;
	}

	.userteam .goodsinfo .num {
		display: flex;
		justify-content: space-between;
		margin-top: 30rpx;
	}

	.userteam .goodsinfo .num text {
		color: #EC5211;
	}

	.userteam .goodsinfo .num .number {
		color: #777;
		font-size: 26rpx;
	}
</style>
